package com.runrunfast.fxj.mapper.provider;

import com.runrunfast.fxj.form.PageForm;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author: 陈胤训
 * @create: 2019-03-19 15:15
 **/
public class SysUserMapperProvider {

    public String getPageUserList(@Param("pageVo") PageForm pageVo, @Param("username") String username){
        return new SQL(){{
            SELECT("*");
            FROM("sys_user");
            if (username != null){
                WHERE(" user_name like concat('%',#{username},'%') ");
            }
            ORDER_BY(" sys_user_id asc  limit #{pageVo.current},#{pageVo.size}");
        }}.toString();
    }
}
